﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OptionsForm;

namespace HighScores
{
    public partial class Scores : Form
    {
        private int time;
        private Level level;
        public ScoreKeeper score { get; set; }
        public Scores(int time,Level level)
        {
            this.level = level;
            this.time = time;
            score = new ScoreKeeper();
            InitializeComponent();

            ScoreList.DataSource = score;
        }
        public Scores()
        {
            InitializeComponent();
            score =new ScoreKeeper();
            ScoreList.DataSource = score;
            HideAll();
          
        }
        private void Submit_Click(object sender, EventArgs e)
        {
            score.Add(new Score() { Level = level, Name = textBox1.Text, Time = time });
            score.ScoresWriter();
            HideAll();
        }
        private void HideAll()
        {
            this.textBox1.Hide();
            this.button1.Hide();
            this.label1.Hide();
        }
    }
}
